home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3dm / old-compression / clCreateBuf.z / clCreateBuf
Encoding:
Text File  |  2002-10-03  |  9.0 KB  |  199 lines

  1.  
  2.  
  3.  
  4. ccccllll CCCCrrrreeeeaaaatttteeee////DDDDeeeessssttttrrrrooooyyyy IIIImmmmpppplllliiiicccciiiitttt BBBBuuuuffffffffeeeerrrrssss((((3333ddddmmmm))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      clCreateBuf, clDestroyBuf, clQueryBufferHdl, clQueryHandle - Create and
  10.      destroy implicit buffers, and find related handles.
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<ddddmmmmeeeeddddiiiiaaaa////ccccllll....hhhh>>>>
  14.  
  15.      CCCCLLLLbbbbuuuuffffffffeeeerrrrHHHHddddllll ccccllllCCCCrrrreeeeaaaatttteeeeBBBBuuuuffff((((CCCCLLLLhhhhaaaannnnddddlllleeee hhhhaaaannnnddddlllleeee,,,, iiiinnnntttt bbbbuuuuffffffffeeeerrrrTTTTyyyyppppeeee,,,,
  16.          iiiinnnntttt bbbblllloooocccckkkkssss,,,, iiiinnnntttt bbbblllloooocccckkkkSSSSiiiizzzzeeee,,,, vvvvooooiiiidddd ********bbbbuuuuffffffffeeeerrrrPPPPttttrrrr1111))))
  17.      iiiinnnntttt ccccllllDDDDeeeessssttttrrrrooooyyyyBBBBuuuuffff((((CCCCLLLLbbbbuuuuffffffffeeeerrrrHHHHddddllll bbbbuuuuffffffffeeeerrrrHHHHddddllll))))
  18.      CCCCLLLLbbbbuuuuffffffffeeeerrrrHHHHddddllll ccccllllQQQQuuuueeeerrrryyyyBBBBuuuuffffffffeeeerrrrHHHHddddllll((((CCCCLLLLhhhhaaaannnnddddlllleeee hhhhaaaannnnddddlllleeee,,,,
  19.          iiiinnnntttt bbbbuuuuffffffffeeeerrrrTTTTyyyyppppeeee,,,, vvvvooooiiiidddd ********bbbbuuuuffffffffeeeerrrrPPPPttttrrrr2222))))
  20.      CCCCLLLLhhhhaaaannnnddddlllleeee ccccllllQQQQuuuueeeerrrryyyyHHHHaaaannnnddddlllleeee((((CCCCLLLLbbbbuuuuffffffffeeeerrrrHHHHddddllll bbbbuuuuffffffffeeeerrrrHHHHddddllll))))
  21.  
  22. AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  23.      _h_a_n_d_l_e       A handle to the compressor or decompressor.
  24.  
  25.      _b_u_f_f_e_r_T_y_p_e   The type of buffer, either CCCCLLLL____BBBBUUUUFFFF____FFFFRRRRAAAAMMMMEEEE or
  26.                   CCCCLLLL____BBBBUUUUFFFF____CCCCOOOOMMMMPPPPRRRREEEESSSSSSSSEEEEDDDD.
  27.  
  28.      _b_l_o_c_k_s       The number of blocks in the buffer.
  29.  
  30.      _b_l_o_c_k_S_i_z_e    The size in bytes of each block.  This must be equal to the
  31.                   frame size for CL_BUF_FRAME, and 1 for CL_BUF_COMPRESSED.
  32.  
  33.      _b_u_f_f_e_r_P_t_r_1   A pointer to a pointer to the buffer space. If _b_u_f_f_e_r_P_t_r_1 is
  34.                   NULL, ccccllllCCCCrrrreeeeaaaatttteeeeBBBBuuuuffff will allocate the blocks.  If _b_u_f_f_e_r_P_t_r_1
  35.                   is not NULL and *_b_u_f_f_e_r_P_t_r_1 is NULL, ccccllllCCCCrrrreeeeaaaatttteeeeBBBBuuuuffff will
  36.                   allocate the blocks and set *_b_u_f_f_e_r_P_t_r_1 to point to the new
  37.                   space.  Otherwise, the space at *_b_u_f_f_e_r_P_t_r_1 will be managed
  38.                   as the ring buffer.  See the NOTES section below for more
  39.                   information.
  40.  
  41.      _b_u_f_f_e_r_H_d_l    The handle to the buffer.
  42.  
  43.      _b_u_f_f_e_r_P_t_r_2   A pointer to a pointer to the buffer space.  If _b_u_f_f_e_r_P_t_r_2
  44.                   is not NULL, ccccllllQQQQuuuueeeerrrryyyyBBBBuuuuffffffffeeeerrrrHHHHddddllll will set *_b_u_f_f_e_r_P_t_r_2 to point
  45.                   to the buffer space.
  46.  
  47.  
  48. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  49.      ccccllllCCCCrrrreeeeaaaatttteeeeBBBBuuuuffff is used to create a CL ring buffer.  These ring buffers are
  50.      needed for the "Implicit Buffering" model of data processing, where
  51.      buffers are not specified in the processing call.  Implicit buffering is
  52.      invoked for ccccllllCCCCoooommmmpppprrrreeeessssssss and ccccllllDDDDeeeeccccoooommmmpppprrrreeeessssssss by giving NULL as the frameBuffer
  53.      or compressedBuffer.
  54.  
  55.      Compressors and decompressors have buffers of type CL_BUF_FRAME and
  56.      CL_BUF_COMPRESSED.
  57.  
  58.      Buffer space may be allocated by either the application or the library.
  59.      The former is useful if there already exists memory space that contains
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ccccllll CCCCrrrreeeeaaaatttteeee////DDDDeeeessssttttrrrrooooyyyy IIIImmmmpppplllliiiicccciiiitttt BBBBuuuuffffffffeeeerrrrssss((((3333ddddmmmm))))
  71.  
  72.  
  73.  
  74.      data to be processed, or holds results to be read.  In this case,
  75.      creating the ring buffer directly from this memory saves on potential
  76.      copies to or from the CL buffer.
  77.  
  78.      ccccllllDDDDeeeessssttttrrrrooooyyyyBBBBuuuuffff is used to deallocate the CL buffer.  ccccllllQQQQuuuueeeerrrryyyyBBBBuuuuffffffffeeeerrrrHHHHddddllll is
  79.      used to find the buffer handle from a compressor or decompressor handle.
  80.      ccccllllQQQQuuuueeeerrrryyyyHHHHaaaannnnddddlllleeee is used to find the processing object handle from a buffer
  81.      handle.
  82.  
  83.      An application may read from and write to these buffers using the
  84.      additional calls ccccllllQQQQuuuueeeerrrryyyyFFFFrrrreeeeeeee, ccccllllUUUUppppddddaaaatttteeeeHHHHeeeeaaaadddd, ccccllllQQQQuuuueeeerrrryyyyVVVVaaaalllliiiidddd, ccccllllUUUUppppddddaaaatttteeeeTTTTaaaaiiiillll,
  85.      and ccccllllDDDDoooonnnneeeeUUUUppppddddaaaattttiiiinnnnggggHHHHeeeeaaaadddd.
  86.  
  87.  
  88. NNNNOOOOTTTTEEEESSSS
  89.      Some schemes may have constraints on the alignment of their buffers.
  90.      Specifying the _b_u_f_f_e_r_P_t_r_1 argument to ccccllllCCCCrrrreeeeaaaatttteeeeBBBBuuuuffff as NULL and then using
  91.      only the read/write functions will allow the application to work with
  92.      every scheme.
  93.  
  94.  
  95. RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEESSSS
  96.      ccccllllCCCCrrrreeeeaaaatttteeeeBBBBuuuuffff returns the buffer handle used in subsequent buffering calls,
  97.      or NULL on failure.  ccccllllDDDDeeeessssttttrrrrooooyyyyBBBBuuuuffff returns SUCCESS, or a negative error
  98.      code on failure.  ccccllllQQQQuuuueeeerrrryyyyBBBBuuuuffffffffeeeerrrrHHHHddddllll returns the handle to the buffer, or
  99.      NULL on failure.  ccccllllQQQQuuuueeeerrrryyyyHHHHaaaannnnddddlllleeee returns the handle to the processing
  100.      object, or NULL on failure.
  101.  
  102.  
  103.  
  104. EEEEXXXXAAAAMMMMPPPPLLLLEEEE
  105.           #include <dmedia/cl.h>
  106.           CLhandle  handle;
  107.           CLbufferHdl    bufferHdl;
  108.           void           *buffer;
  109.            ...
  110.           clOpenCompressor(CL_MVC1_SOFTWARE, &handle);
  111.            ...
  112.           /* Create a buffer of 10 blocks of size 10000 */
  113.           buffer = malloc(10*10000);
  114.           bufferHdl = clCreateBuf(handle, CL_BUF_FRAME, 10, 10000, &buffer);
  115.           bufferHdl = clQueryBufferHdl(handle, CL_BUF_FRAME, &buffer);
  116.           handle = clQueryHandle(bufferHdl);
  117.            ...
  118.           clDestroyBuf(bufferHdl);
  119.           clCloseCompressor(handle);
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. ccccllll CCCCrrrreeeeaaaatttteeee////DDDDeeeessssttttrrrrooooyyyy IIIImmmmpppplllliiiicccciiiitttt BBBBuuuuffffffffeeeerrrrssss((((3333ddddmmmm))))
  137.  
  138.  
  139.  
  140. SEE ALSO
  141.      CLintro(3dm), clQueryFree(3dm), clUpdateHead(3dm), clQueryValid(3dm),
  142.      clUpdateTail(3dm), clDoneUpdatingHead(3dm)
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.